package com.retailshop.shopuser;

import com.retailshop.shopuser.entity.SignIn;
import com.retailshop.shopuser.service.SignInService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class SignDays {

    @Autowired
    SignInService signInService;

    @Test
    public void test() {
        List<SignIn> signInsList = signInService.selectList();
        if (!signInsList.isEmpty()) {
            SignIn signIn = null;
            for (int i = 0; i < signInsList.size(); i++) {
                signIn = new SignIn();
                signIn.setSignDays(signInsList.get(i).getDays());
                signIn.setDays(signInsList.get(i).getDays());
                    signIn.setSignInId(signInsList.get(i).getSignInId());
                   int row= signInService.updateByPrimaryKeySelective(signIn);
            }
        }

    }


}
